package com.kmzx.one.project.mapper;

import com.github.pagehelper.Page;
import com.kmzx.one.project.entity.UserRank;
import com.kmzx.one.project.entity.UserRankBuy;
import com.kmzx.one.project.entity.UserRankDetail;
import com.kmzx.one.project.entity.UserRankHistory;
import com.kmzx.one.project.others.common.UserRankDetailInfo;
import com.kmzx.one.project.others.dso.UserRankDso;
import com.kmzx.one.project.others.dso.UserRankMoney;
import com.kmzx.one.project.others.dto.UserProfitDetailInfo;
import com.kmzx.one.project.others.dto.UserRankInfo;
import com.kmzx.one.project.others.dto.UserRankMoreInfo;
import com.kmzx.one.project.others.dto.UserRankUPInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserRankMapper {

    /**
     * 查询所有的等级信息
     *
     * @return
     */
    List<UserRankDso> selectAllRankTabs();

    UserRankInfo selectUserRankTabs(@Param("userId") String userId);

    UserRank selectUserRankByUserId(@Param("userId") String userId);

    Page<UserRankMoreInfo> selectTopRankUser(@Param("userId") String userId);

    Page<UserRankMoreInfo> selectTopRankUserSearch(@Param("userId") String userId, @Param("nickName") String nickName);

    int insert(UserRank record);

    UserRankMoney selectUserRankAndMoney(@Param("userId") String userId);

    void insertUserRankDetail(UserRankDetail userRankDetail);

    void updateUserRankBuyByIdSelective(UserRankBuy rankBuy);

    void updateByIdSelective(UserRank userRank);

    int insertUserRankHistory(UserRankHistory rankHistory);

    List<String> selectUserFather(@Param("userId") String userId);

    UserRankDetail selectRankDetailById(@Param("id") String id);

    String findRankBuyNickName(String orderCodes);

    Page<UserRankDetailInfo> selectUserRankUpInfo(String userId);

    UserRankUPInfo selectUserRankUpHistory(@Param("userId") String userId);

    void updateUserRankHistorySend(@Param("userId") String userId, @Param("tosend") Integer tosend);

}
